﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<OptimumInfra.Models.TemplateCategory>" %>


<asp:Content ID="registerContent" ContentPlaceHolderID="AdminContent" runat="server">
    <h2>Create a New Category</h2>

    <% using (Html.BeginForm("CreateCategory", "Template", FormMethod.Post,new { id = "createCategory", name = "createCategory" }))
       { %>
        <%: Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")%>
                <legend>Account Information</legend>
          <table width="700px" style="margin-top: 10px;">
          <tr>
          <td>          
                <div class="editor-label">
                    <%: Html.LabelFor(category => category.Name)%>
                </div>
            </td> 
            <td>
                <div class="editor-field">
                    <%: Html.TextBoxFor(category => category.Name)%>
                    <%: Html.ValidationMessageFor(category => category.Name)%>
                </div>
           </td> 
          </tr>
          <tr>       
            <td>
                <div class="editor-label">
                    <%: Html.LabelFor(m => m.Description)%>
                </div>
            </td>
            <td>
                <div class="editor-field">
                    <%: Html.TextAreaFor(category => category.Description, 4, 10, new {style = "width: 95%; height:200px;", @class = "textarea" })%>
                    <%: Html.ValidationMessageFor(category => category.Description)%>
                </div>
            </td>
                </div>
            </td>
          </tr>     
          <tr>       
            <td colspan="2">
                <p>
                    <input type="submit" value="Create" />
                </p>
            </td>
          </tr>    
                
            </table>
    <% } %>

     <script type="text/javascript">
         $(document).ready(function () {

             $("#createCategory").validate({
                 rules: {
                     Name: "required" // simple rule, converted to {required:true} 
                
                 },
                 messages: { Name: "* Name is required" }

             });
         }); 
	  </script>
</asp:Content>
